home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / mus / play / playsid2_1.dms / playsid2_1.adf / jukebox.rexx < prev    next >
OS/2 REXX Batch file  |  1992-12-03  |  780b  |  40 lines

  1. /*
  2.  * PlaySID ARexx Example
  3.  *
  4.  * rx jukebox 'datafile'
  5.  *
  6.  */
  7.  
  8. if(~show('l', 'rexxsupport.library'))then do
  9.    if(~addlib( 'rexxsupport.library', 0, -30, 0))then do
  10.       say "Could not open ARexx support library."
  11.       exit 10
  12.    end
  13. end
  14.  
  15. file = 'file'
  16. parse arg data
  17.  
  18. if open(file, data, 'r') then do
  19.    address command "run SID:PlaySID"
  20.    line = readln(file)
  21.    do while ~eof(file)
  22.       name = word(line, 1)
  23.       tune = word(line, 2)
  24.       time = word(line, 3)
  25.       if SID_Load(name) then do
  26.          say "Playing tune" tune "for" time "seconds in" name
  27.          SID_SetTune(tune)
  28.          SID_Play()
  29.          Delay(time * 50)
  30.          SID_Stop()
  31.       end
  32.       line = readln(file)
  33.    end
  34.    SID_Quit()
  35.    call close(file)
  36. end
  37. else
  38.    say "Unable to open file" data"."
  39.  
  40.